//
//  BQButton.m
//  BeeQuick
//
//  Created by Vivitickey on 2017/4/26.
//  Copyright © 2017年 test. All rights reserved.
//

#import "BQButton.h"
#import <Masonry.h>

@implementation BQButton

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    
    return self;
    
}

-(void)setupUI{
    
    UILabel *label = [[UILabel alloc]init];
    
    label.text = @"配送至:";
    
    label.font = [UIFont systemFontOfSize:11];
    
    [self addSubview:label];
    
    UILabel *adressLabel = [[UILabel alloc]init];
    
//    adressLabel.text = _text;
    
    adressLabel.text = @"人民广场";
    
    adressLabel.font = [UIFont systemFontOfSize:14];
    
    [self addSubview:adressLabel];
    
    UIImageView *imageView = [[UIImageView alloc]init];
    
    imageView.image = [UIImage imageNamed:@"control-down"];
    
    [self addSubview:imageView];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20);
        
        make.bottom.offset(-10);
    }];
    
    [adressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(label.mas_right).offset(2);
        
        make.bottom.equalTo(label.mas_bottom);
    }];
    
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_offset(7);
        
        make.height.mas_offset(4);
        
        make.top.equalTo(adressLabel.mas_centerY);
        
        make.left.equalTo(adressLabel.mas_right).offset(2);
    }];
    
    
    
    
}

@end
